const baseUrl = 'https://d.dutall.com';
// const baseUrl = 'http://192.168.1.52:8002';
// const baseUrl = 'http://192.168.97.102:80';


const app = getApp()
const getRequest = (url, data = {}) => {
    return new Promise((resolve, reject) => {
        wx.request({
            url: baseUrl + url,
            data,
            method: 'GET',
            success: function (res) {
                resolve(res.data)
            },
            fail: function (res) {
                reject(res)
            }
        })
    })
}
const postRequest = (url, data = {}) => {
    return new Promise((resolve, reject) => {
        wx.request({
            url: baseUrl + url,
            data,
            header: {
                'content-type': 'application/json'
            },
            method: 'POST',
            success: function (res) {
                resolve(res.data)
            },
            fail: function (res) {
                reject(res)
            }
        })
    })
}

module.exports = {
    getRequest: getRequest,
    postRequest: postRequest,
    //  GO_:BC-34044c64b82b4e3cbb00a58ebeb724be
}
